package cn.edu.hit.selflearning;

import cn.edu.hit.kg.data.GraphData;

import java.util.Comparator;
import java.util.stream.Collectors;

public class ComponentCompare {
    public static void main(String[] args) {
        GraphData graphData = GraphData.getInstance();
        graphData.getByLabel("Component")
                .collect(Collectors.groupingBy(node -> node.get("name")))
                .entrySet()
                .stream()
                .filter(entry -> entry.getValue().size() > 1)
                .forEach(entry -> {
                    System.out.println("名称：" + entry.getKey());
                    System.out.println(entry.getValue());
                });
    }
}
